The present invention relates to received data packets in a network, and more particularly to the removing unwanted header information from received data packets in the network.
Home networks are becoming more common and desirable for connecting computers within a home. One type of home network is the home phone line network which uses telephone lines typically installed in residence homes for communication between computers in the home. The Home Phone Line Networking Alliance (HPNA) has published a specification to standardize the behavior of home phone line networks.
FIG. 1 illustrates the frame format according to the HPNA standard version 2.0. The frame includes a known 64 symbol preamble 102 and frame control bits 104. The frame control bits 104 include information concerning the modulation format and other miscellaneous control information, such as cyclical redundancy check (CRC) bits. The frame also includes a six-byte destination address 106, a six-byte source address 108, an eight-byte limited automatic repeat request (LARQ) 110, a four-byte Q Tag 112, and a two-byte length/type information 114. The LARQ 110 conveys link layer priority information and provides a negative acknowledgment protocol to increase the speed of frame retransmission. The Q Tag 112 contains information which may be used to prioritize data frames. The preamble 102 through the Q Tag 112 comprise the xe2x80x9cheaderxe2x80x9d of the frame. The remainder of the frame comprise the data 116, which can be between 46 to 1500 bytes. The data 116 is followed by four bytes of frame check sequence (FCS) 118, which is used to check for errors in the frame. A frame need not have both the LARQ 110 and the Q Tag 112. The frame may have the LARQ 110 without the Q Tag 112, the Q Tag 112 without the LARQ 110, or neither the LARQ 110 nor the Q Tag 112.
FIG. 2 illustrates a typical hardware-software interface for a home phone line network. The interface comprises a HPNA-compatible network interface controller (NIC) 206 which receives frames from a phone line. The NIC 206 sends the frame to a HPNA-compatible driver software 204 which is typically on a host computer. The driver software 204 then sends the frame to an upper layer software 202, such as the Network Driver Interface Specification (NDIS).
However, the upper layer 202 may not understand the LARQ 110 and/or the Q Tag 112 and erroneously see the frame as invalid. Thus, before the driver software 204 passes the frame to the upper layer software 202, the LARQ 110 and the Q Tag 112 must be removed from the frame.
Conventionally, when the NIC 206 forwards a frame, the frame is stored in a single buffer in the upper layer 202. Typically, to remove the LARQ 110 and the Q Tag 112 from the frame, all of the bytes before and after the LARQ 110 and Q Tag 112 are copied to a separate buffer without gaps between the bytes. However, copying all of these bytes wastes valuable processor cycles and adds unwanted latency to the packet receive process.
Accordingly, there exists a need for an improved method and system for removing unwanted header information from a frame in a network. The present invention addresses such a need.
A method for removing unwanted header information from a frame in a network is disclosed. It includes: storing beginning bytes of the frame in a first buffer and remaining bytes in a second buffer, where a size of the first buffer is smaller than the second buffer; determining the unwanted header information is stored in the first buffer; copying bytes of the frame after the unwanted header information which are stored in the first buffer over the unwanted header information; reporting a number of bytes of the frame stored in the first buffer to be retrieved; and retrieving the reported number of bytes of the frame stored in the first buffer and the bytes of the frame stored in the second buffer. The copying of bytes occur exclusively in the first buffer. Thus, removing the unwanted header information requires fewer processor cycles and minimizes latency in the packet receive process.